import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import uci.utils.RunningTime;

public class EntryMapTest
{
	public static void main(String[] args)
	{

		RunningTime rt = new RunningTime();
		System.out.println("start");
		rt.start();
		HashMap<Integer, String> bulk = new HashMap<Integer, String>();
		for (Integer i = 0; i < 5e6; i++)
		{
			bulk.put(i,"stringa "+i);		
		}
		rt.stop();
		System.out.println(bulk.size() + "   load: "+rt);
		
		rt = new RunningTime();
		rt.start();
		Set<Integer> key = bulk.keySet();
		for(Integer k : key){
			bulk.get(k);
		}
		rt.stop();
		System.out.println("key: "+rt);

		rt = new RunningTime();
		rt.start();
		Set<Map.Entry<Integer, String>> entrySet = bulk.entrySet();
		Iterator<Map.Entry<Integer, String>> iter = entrySet.iterator();
		while(iter.hasNext()){
			iter.next().getValue();
		}
		rt.stop();
		System.out.println("entrySet: "+rt);
		
	}
}
